﻿
var _mymap = null;
$(document).ready(function() {
    _mymap = new GpsMap("map_content", $("#map_content").height(), $("#map_content").width(), 114.50099, 38.01846, MapType.GOOGLE);
    _mymap.initMap();
    _mymap.AddControl(ControlType.LARGE);
    _mymap.AddControl(ControlType.MAPTYPE);
    _mymap.AddControl(ControlType.SCALE);
    _mymap.AddControl(ControlType.OVERVIEW);

    document.getElementById("menu_2_content").style.display = "block";
    CreateNewPollMark();


});

function CreateNewPollMark() {
    var str = "<table class='title-font' border='0' cellspacing='0' cellpadding='2' width='400px' bgcolor='#e6e6e6'><tr><td width='40%'><img src='../upload/1.JPG' width='100px' height='100px'/> </td><td width='50%' align='left'><table width='100%' border='0'><tr><td class='biaoge-font' height='25' width='30%' colspan='2 style='border-right-style: solid; border-right-width: thin; border-right-color: #008080' > 污染源名称</td><td class='biaoge-font' height='25' colspan='2'>石家庄噪音污染</td></tr><tr><td class='biaoge-font' height='25' width='30%' colspan='2 style='border-right-style: solid; border-right-width: thin; border-right-color: #008080' > 举报人</td><td class='biaoge-font' height='25' colspan='2'>王建存</td></tr><tr><td class='biaoge-font' height='25' width='30%' colspan='2 style='border-right-style: solid; border-right-width: thin; border-right-color: #008080' > 举报时间</td><td class='biaoge-font' height='25' colspan='2'>2011-8-20 12:31:31</td></tr><tr><td class='biaoge-font' height='25' width='30%' colspan='2 style='border-right-style: solid; border-right-width: thin; border-right-color: #008080' > 当前处理</td><td class='biaoge-font' height='25' colspan='2'>河北省环保厅</td></tr><tr><td class='biaoge-font' height='25' width='30%' colspan='2 style='border-right-style: solid; border-right-width: thin; border-right-color: #008080' > 处理结果</td><td class='biaoge-font' height='25' colspan='2'>处理中</td></tr></table></td></tr>  <tr><td><a href='#'>任务下发</a><a href='#'>查看处理过程</a></td></tr></table>";
    _mymap._InfoHtml = str;
    MarksOnMap('n');
}

function CreateOverPollMark() {
    var str = "<table class='title-font' border='0' cellspacing='0' cellpadding='2' width='400px' bgcolor='#e6e6e6'><tr><td width='40%'><img src='../upload/1.JPG' width='100px' height='100px'/> </td><td width='50%' align='left'><table width='100%' border='0'><tr><td class='biaoge-font' height='25' width='30%' colspan='2 style='border-right-style: solid; border-right-width: thin; border-right-color: #008080' > 污染源名称</td><td class='biaoge-font' height='25' colspan='2'>石家庄噪音污染</td></tr><tr><td class='biaoge-font' height='25' width='30%' colspan='2 style='border-right-style: solid; border-right-width: thin; border-right-color: #008080' > 举报人</td><td class='biaoge-font' height='25' colspan='2'>王建存</td></tr><tr><td class='biaoge-font' height='25' width='30%' colspan='2 style='border-right-style: solid; border-right-width: thin; border-right-color: #008080' > 举报时间</td><td class='biaoge-font' height='25' colspan='2'>2011-8-20 12:31:31</td></tr><tr><td class='biaoge-font' height='25' width='30%' colspan='2 style='border-right-style: solid; border-right-width: thin; border-right-color: #008080' > 当前处理</td><td class='biaoge-font' height='25' colspan='2'>河北省环保厅</td></tr><tr><td class='biaoge-font' height='25' width='30%' colspan='2 style='border-right-style: solid; border-right-width: thin; border-right-color: #008080' > 处理结果</td><td class='biaoge-font' height='25' colspan='2'>处理完毕</td></tr></table></td></tr>  <tr><td><a href='#'>任务下发</a><a href='#'>查看处理过程</a></td></tr></table>";
    _mymap._InfoHtml = str;
    MarksOnMap('o');
}

function CreateSendPollMark() {
    var str = "<table class='title-font' border='0' cellspacing='0' cellpadding='2' width='400px' bgcolor='#e6e6e6'><tr><td width='40%'><img src='../upload/1.JPG' width='100px' height='100px'/> </td><td width='50%' align='left'><table width='100%' border='0'><tr><td class='biaoge-font' height='25' width='30%' colspan='2 style='border-right-style: solid; border-right-width: thin; border-right-color: #008080' > 污染源名称</td><td class='biaoge-font' height='25' colspan='2'>石家庄噪音污染</td></tr><tr><td class='biaoge-font' height='25' width='30%' colspan='2 style='border-right-style: solid; border-right-width: thin; border-right-color: #008080' > 举报人</td><td class='biaoge-font' height='25' colspan='2'>王建存</td></tr><tr><td class='biaoge-font' height='25' width='30%' colspan='2 style='border-right-style: solid; border-right-width: thin; border-right-color: #008080' > 举报时间</td><td class='biaoge-font' height='25' colspan='2'>2011-8-20 12:31:31</td></tr><tr><td class='biaoge-font' height='25' width='30%' colspan='2 style='border-right-style: solid; border-right-width: thin; border-right-color: #008080' > 当前处理</td><td class='biaoge-font' height='25' colspan='2'>藁城市环保局</td></tr><tr><td class='biaoge-font' height='25' width='30%' colspan='2 style='border-right-style: solid; border-right-width: thin; border-right-color: #008080' > 处理结果</td><td class='biaoge-font' height='25' colspan='2'>任务已经下发</td></tr></table></td></tr>  <tr><td><a href='#'>任务下发</a><a href='#'>查看处理过程</a></td></tr></table>";
    _mymap._InfoHtml = str;
    MarksOnMap('s');
}



function MarksOnMap(type) {

    _mymap._Marks.length = 0;
    for (var i = 0; i < 15; i++) {

        var vlat = 'plat' + type + (i + 1);
        var vlng = 'plng' + type + (i + 1);
        var velat = document.getElementById(vlat);
        var velng = document.getElementById(vlng);
        if (velat != null && velng != null) {
            var valat = velat.value;
            var valng = velng.value;
            _mymap.CreatMark(valat, valng);

        }

        _mymap.ShowMarks();


    }



}


function selectTag(showContent, selfObj) {
    // 操作标签
    var tag = document.getElementById("tags").getElementsByTagName("li");
    var taglength = tag.length;
    for (i = 0; i < taglength; i++) {
        tag[i].className = "";
    }
    selfObj.parentNode.className = "selectTag";
    // 操作内容
    for (i = 0; j = document.getElementById("tagContent" + i); i++) {
        j.style.display = "none";
    }
    document.getElementById(showContent).style.display = "block";
}



function Setvisble() {
    document.getElementById("menus").style.display = "none";
    document.getElementById("metacontent").style.display = "block";

    document.getElementById("ditu").setAttribute("className", " ");
    document.getElementById("shuju").setAttribute("className", "selectTag");
}

function SetCX() {
    document.getElementById("menus").style.display = "block";
    document.getElementById("metacontent").style.display = "none";

    document.getElementById("shuju").setAttribute("className", " ");
    document.getElementById("ditu").setAttribute("className", "selectTag");
}

function showMyPlace(divIds) {
    // document.getElementById(divIds).innerHTML = "";
    document.getElementById("menu_2_content").style.display = "none"
    document.getElementById("menu_3_content").style.display = "none";
    document.getElementById("menu_4_content").style.display = "none"; ;
    document.getElementById("p1").innerHTML = "";
    document.getElementById(divIds).style.display = "block";
    //document.getElementById("classQuery").style.display = "none";
    document.getElementById("p1").style.display = "block";
}
function closeMyPlace(divIds) {

    document.getElementById(divIds.id).style.display = "none";
    document.getElementById("classQuery").style.display = "block";
    document.getElementById("p1").style.display = "none";
}
function setPlace(str, contrName, divIds) {
    document.getElementById(contrName).value = str;
    closeMyPlace(divIds);
}
function settxt(str, contrName) {
    document.getElementById(contrName).value = str;
}
function ShowHiddenOverView() {
    var Obj = document.getElementById("OverviewDiv").style.display;
    if (Obj == "block") {
        document.getElementById("imgHawkEye").src = "images/map/Show.gif";
        document.getElementById("OverviewDiv").style.display = "none";
        //DestroyingHawkEye(); //摧毁鹰眼地图
    }
    else {
        document.getElementById("imgHawkEye").src = "images/map/hide.gif";
        document.getElementById("OverviewDiv").style.display = "block";
        //LoadHawkEyeMap(); //加载鹰眼地图

    }
}
function transt() {
    var qs = document.getElementById("txtqs").value;
    var zd = document.getElementById("txtdd").value;
    var zj;
    zj = zd;
    zd = qs;
    qs = zj;
    document.getElementById("txtqs").value = qs;
    document.getElementById("txtdd").value = zd;
}

function gotomark(index) {

    _mymap.GoToMark(index);
}
        
    
       
